/* 港口白和蓝色调 */
:root {
    --port-blue: #0077b6;
    --light-port-blue: #90e0ef;
    --port-white: #f5f5f5;
    --dark-text: #333;
    --light-text: #666;
    --sidebar-bg: #003366;
    --sidebar-hover: #0055a5;
    --sidebar-active: #0099ff;
    --delete-red: #e74c3c;
    --edit-green: #2ecc71;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--port-white);
    color: var(--dark-text);
}

/* 登录页面样式 */
.container {
    display: flex;
    height: 100vh;
}

.image-section {
    flex: 2;
    background-color: #ddd; /* 占位符背景色 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0f7fa, #ffffff);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.login-form {
    width: 80%;
    max-width: 300px;
    padding: 2em;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5em;
    color: var(--port-blue);
    font-weight: 600;
}

.input-group {
    margin-bottom: 1.5em;
}

.input-group label {
    display: block;
    margin-bottom: 0.5em;
    color: var(--light-text);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-size: 1em;
}

.input-group input:focus {
    border-color: var(--port-blue);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.2);
    outline: none;
}

.input-group select {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-size: 1em;
    background-color: white;
}

.input-group select:focus {
    border-color: var(--port-blue);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.2);
    outline: none;
}

button {
    width: 100%;
    padding: 0.7em;
    background: linear-gradient(to right, var(--port-blue), var(--light-port-blue));
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
    background: linear-gradient(to right, #005f8d, #6bcbdd);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 主页面样式 */
.main-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    flex: 1;
    max-width: 20%;
    background-color: var(--sidebar-bg);
    color: white;
    padding: 20px 0;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
}

.sidebar .logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar .logo h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--port-white);
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav ul li {
    margin-bottom: 5px;
}

.sidebar nav ul li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 5px solid transparent;
}

.sidebar nav ul li a:hover {
    background-color: var(--sidebar-hover);
    border-left: 5px solid var(--sidebar-active);
}

.sidebar nav ul li a.active {
    background-color: var(--sidebar-hover);
    border-left: 5px solid var(--sidebar-active);
}

.sidebar nav ul li a .icon {
    font-size: 1.2em;
    margin-right: 15px;
}

.sidebar nav ul li a .title {
    font-size: 1em;
}

.main-content {
    flex: 4;
    padding: 20px;
    background-color: var(--port-white);
    display: flex;
    flex-direction: column;
}

.search-box {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    width: 100%;
}

.search-box input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

.search-box button {
    flex: 0 0 20%; /* 占据右侧1/5宽度 */
    padding: 8px 12px;
    background-color: var(--port-blue);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.9em;
}

.search-box button:hover {
    background-color: var(--light-port-blue);
    color: var(--dark-text);
}

.data-table {
    overflow-x: auto;
    flex: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    font-size: 0.9em;
}

th {
    background-color: var(--port-blue);
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #e1f5fe;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
}

.edit-btn, .delete-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 80px;
}

.edit-btn {
    background-color: var(--edit-green);
    color: white;
}

.delete-btn {
    background-color: var(--delete-red);
    color: white;
}

.edit-btn:hover {
    background-color: #27ae60;
    transform: scale(1.05);
}

.delete-btn:hover {
    background-color: #c0392b;
    transform: scale(1.05);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.modal-content h2 {
    margin-top: 0;
    color: var(--port-blue);
    text-align: center;
}

.modal-content .input-group {
    margin-bottom: 1em;
}

.modal-content .input-group label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
}

.modal-content .input-group input,
.modal-content .input-group select {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.modal-content .input-group button {
    width: auto;
    display: inline-block;
    margin-right: 10px;
    padding: 0.7em 1.5em;
}